home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbinst13 / vbwarn.frm < prev    next >
Text File  |  1995-12-05  |  4KB  |  143 lines

  1. VERSION 2.00
  2. Begin Form Warn 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Overwrite Warning!"
  6.    ClientHeight    =   1230
  7.    ClientLeft      =   1335
  8.    ClientTop       =   4605
  9.    ClientWidth     =   7020
  10.    ControlBox      =   0   'False
  11.    Height          =   1635
  12.    Left            =   1275
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form2"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   1230
  18.    ScaleWidth      =   7020
  19.    Top             =   4260
  20.    Width           =   7140
  21.    Begin CommandButton Cmd_Warn 
  22.       Cancel          =   -1  'True
  23.       Caption         =   "&Cancel"
  24.       Height          =   375
  25.       Index           =   3
  26.       Left            =   5400
  27.       TabIndex        =   1
  28.       Top             =   720
  29.       Width           =   1335
  30.    End
  31.    Begin CommandButton Cmd_Warn 
  32.       Caption         =   "&No"
  33.       Default         =   -1  'True
  34.       Height          =   375
  35.       Index           =   2
  36.       Left            =   3960
  37.       TabIndex        =   0
  38.       Top             =   720
  39.       Width           =   1335
  40.    End
  41.    Begin CommandButton Cmd_Warn 
  42.       Caption         =   "Yes to &All"
  43.       Height          =   375
  44.       Index           =   1
  45.       Left            =   2520
  46.       TabIndex        =   2
  47.       Top             =   720
  48.       Width           =   1335
  49.    End
  50.    Begin CommandButton Cmd_Warn 
  51.       Caption         =   "&Yes"
  52.       Height          =   375
  53.       Index           =   0
  54.       Left            =   1080
  55.       TabIndex        =   3
  56.       Top             =   720
  57.       Width           =   1335
  58.    End
  59.    Begin PictureBox Picture1 
  60.       AutoSize        =   -1  'True
  61.       BackColor       =   &H00C0C0C0&
  62.       BorderStyle     =   0  'None
  63.       ForeColor       =   &H00000000&
  64.       Height          =   480
  65.       Left            =   240
  66.       Picture         =   VBWARN.FRX:0000
  67.       ScaleHeight     =   480
  68.       ScaleWidth      =   480
  69.       TabIndex        =   5
  70.       Top             =   360
  71.       Width           =   480
  72.    End
  73.    Begin Label Lbl_Warn 
  74.       BackColor       =   &H00C0C0C0&
  75.       Height          =   495
  76.       Left            =   1080
  77.       TabIndex        =   4
  78.       Top             =   120
  79.       Width           =   5655
  80.    End
  81. End
  82.  
  83. Sub Cmd_Warn_Click (Index As Integer)
  84.     
  85.     Select Case (Index)
  86.     Case 0    'Overwrite the file
  87.         Warn.Hide
  88.         install.Refresh
  89.         install.Lbl_List.Caption = "Now copying file " + FileStr$
  90.         FileCopy Source$, Dest$
  91.         install.List1.AddItem Dest$
  92.     Case 1
  93.         Warn.Hide      'Set WarnFlag to False so overwrite
  94.         install.Refresh
  95.         install.Lbl_List.Caption = "Now copying file " + FileStr$
  96.         FileCopy Source$, Dest$
  97.         install.List1.AddItem Dest$
  98.         WarnFlag = False 'warning is no longer displayed
  99.     Case 2   ' no over writing
  100.         Warn.Hide
  101.     Case 3  'Cancel install
  102.         Warn.Hide
  103.         Msg$ = "Are you sure you want to cancel install?"  'give the user a second change
  104.         Title$ = "CANCEL???"
  105.         Response% = MsgBox(Msg$, 292, Title$)  ' Get user response. '36+4+256
  106.         If Response% = IDYES Then   ' Evaluate response
  107.         install.Hide
  108.         Msg$ = "Installation aborted"
  109.         Title$ = "Install"
  110.         MsgBox Msg$, 64, Title$
  111.         End
  112.         Else
  113.         install.Lbl_List.Caption = "Now copying file " + FileStr$
  114.         FileCopy Source$, Dest$
  115.         install.List1.AddItem Dest$
  116.         Exit Sub
  117.         End If
  118.     End Select
  119. End Sub
  120.  
  121. Sub Cmd_Warn_KeyPress (Index As Integer, KeyAscii As Integer)
  122.     
  123.     'do command if user press key equivalent to button
  124.     Select Case KeyAscii
  125.     Case Asc("y"), Asc("Y")
  126.     Cmd_Warn_Click (0)
  127.     Case Asc("a"), Asc("A")
  128.     Cmd_Warn_Click (1)
  129.     Case Asc("n"), Asc("N")
  130.     Cmd_Warn_Click (2)
  131.     Case Asc("c"), Asc("C")
  132.     Cmd_Warn_Click (3)
  133.     End Select
  134. End Sub
  135.  
  136. Sub Form_Load ()
  137.     ' Center on the screen
  138.     '
  139.      Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  140.     Screen.MousePointer = 0 'default
  141. End Sub
  142.  
  143.